/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-02-25
 * Time: 22:44
 */
public class TestDemo {
    public static void main(String[] args) {
        Database changed
        mysql> show tables;
        Empty set (0.00 sec)

        mysql> use java108;
        Database changed
        mysql> create table student;
        ERROR 1113 (42000): A table must have at least 1 column
        mysql> create table student(name varchar(20),age int);
        Query OK, 0 rows affected (0.04 sec)

        mysql> insert into student values('张三丰',18),('魏子涵',25),('王麻子',19),('张大大',29),('张译',18),('张颂文',18),('徐江',28);
        Query OK, 7 rows affected (0.01 sec)
        Records: 7  Duplicates: 0  Warnings: 0

        mysql> selsec *from student;
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selsec *from student' at line 1
        mysql> select *from student;
        +-----------+------+
                | name      | age  |
                +-----------+------+
                | 张三丰    |   18 |
| 魏子涵    |   25 |
| 王麻子    |   19 |
| 张大大    |   29 |
| 张译      |   18 |
| 张颂文    |   18 |
| 徐江      |   28 |
                +-----------+------+
                        7 rows in set (0.00 sec)

        mysql> select* from student where name like '张%'and age between 18 and 25;
        +-----------+------+
                | name      | age  |
                +-----------+------+
                | 张三丰    |   18 |
| 张译      |   18 |
| 张颂文    |   18 |
                +-----------+------+
                        3 rows in set (0.00 sec)

        mysql> select* from goods;
        +--------------+-------+---------+-------------+
                | name         | price | reserve | descbrition |
                +--------------+-------+---------+-------------+
                | 学生书包     |    19 |     101 | NULL        |
                +--------------+-------+---------+-------------+
                        1 row in set (0.01 sec)

        mysql> update goods set price=price+30 where price>30;
        Query OK, 0 rows affected (0.00 sec)
        Rows matched: 0  Changed: 0  Warnings: 0

        mysql> create table article (issue datetime);
        Query OK, 0 rows affected (0.03 sec)

        mysql> create table article (issue datetime);
        ERROR 1050 (42S01): Table 'article' already exists
        mysql> insert into article values(2019-1-1 10:30),(2019-11-10 16:02),(2019-11-09 16:02),(2019-02-14 16:02);
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10:30),(2019-11-10 16:02),(2019-11-09 16:02),(2019-02-14 16:02)' at line 1
        mysql> insert into article values('2019-1-1 10:30'),('2019-11-10 16:02'),('2019-11-09 16:02'),('2019-02-14 16:02');
        Query OK, 4 rows affected (0.01 sec)
        Records: 4  Duplicates: 0  Warnings: 0

        mysql> select* from article;
        +---------------------+
                | issue               |
                +---------------------+
                | 2019-01-01 10:30:00 |
| 2019-11-10 16:02:00 |
| 2019-11-09 16:02:00 |
| 2019-02-14 16:02:00 |
                +---------------------+
                        4 rows in set (0.00 sec)

        mysql> select* from article where issue between ' 2019-1-1 10:30' and '2019-11-10 16:02';
        +---------------------+
                | issue               |
                +---------------------+
                | 2019-01-01 10:30:00 |
| 2019-11-10 16:02:00 |
| 2019-11-09 16:02:00 |
| 2019-02-14 16:02:00 |
                +---------------------+
                        4 rows in set (0.00 sec)

        mysql> create table article1(title varchar(20),create_time datetime);
        Query OK, 0 rows affected (0.04 sec)

        mysql> insert into article1 values('如何走向成功','2019-1-1 08:30'),('如何走向成功','2018-10-1 08:30'),('如何走向成功','2025-10-11 08:30');
        Query OK, 3 rows affected (0.00 sec)
        Records: 3  Duplicates: 0  Warnings: 0

        mysql> select* from article;
        +---------------------+
                | issue               |
                +---------------------+
                | 2019-01-01 10:30:00 |
| 2019-11-10 16:02:00 |
| 2019-11-09 16:02:00 |
| 2019-02-14 16:02:00 |
                +---------------------+
                        4 rows in set (0.00 sec)

        mysql> select* from article1;
        +--------------------+---------------------+
                | title              | create_time         |
                +--------------------+---------------------+
                | 如何走向成功       | 2019-01-01 08:30:00 |
| 如何走向成功       | 2018-10-01 08:30:00 |
| 如何走向成功       | 2025-10-11 08:30:00 |
                +--------------------+---------------------+
                        3 rows in set (0.00 sec)

        mysql> select* from article1 where title is null and create_time>2019-01-01;
        Empty set, 1 warning (0.00 sec)

        mysql> select* from article1 where title is null and create_time>2019-01-01 08:30;
        ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '08:30' at line 1
        mysql> select* from article1 where title is null and create_time>'2019-01-01 08:30';
        Empty set (0.00 sec)

        mysql> select* from book where author!=null or price>50 and publish_date>'2019';
        ERROR 1146 (42S02): Table 'java108.book' doesn't exist
        mysql> select* from user where id( between 1 and 200  or between 300 and 500) and account!=null';
        '> select* from user where amount >1000;
        '> select* from book where author is not null or price>50 and publish_date>'2019';




















































    }
}
